<!--  -->
<template>
  <div>添加老人
    <el-tabs
    v-model="activeName"
    type="card"
    class="demo-tabs"
    @tab-click="handleClick"
  >
    <el-tab-pane label="基本信息" name="first">

 
      <Info></Info>
    </el-tab-pane>
    <el-tab-pane label="健康信息" name="second">
      <Nowillness></Nowillness>
      <Oldillness></Oldillness>
      <Otherillness></Otherillness>
    </el-tab-pane>
    <el-tab-pane label="家属信息" name="third">家属信息</el-tab-pane>
  </el-tabs>
   
  <el-button>返回</el-button>
    <el-button type="primary"  @click="submit">提交</el-button>

  </div>
</template>

<script lang='ts' setup>
import { TabsPaneContext } from 'element-plus';
import { reactive,toRefs,ref,onMounted, provide} from 'vue'

import Info from '../../components/elderly/Info.vue';
import { Elderly } from '../../apis/elderly/type';
import Nowillness from '../../components/elderly/Nowillness.vue';
import Oldillness from '../../components/elderly/Oldillness.vue';
import Otherillness from '../../components/elderly/Otherillness.vue';

const elderlyData = reactive<any>({
    name: "",
    mobile:"",
    photo: "",
    gender: 1,
    birthday:"",
    nativePlace: "",
    nation:"",
    idCard:"",
    politics: "",
    socialCard: "",
    marriage: "",
    eduLevel: "",
    education: "",
    resident: "",
    address: "",
    health: {
        oldillness:"",
        nowillness: "",
        otherillness: "",
        otherCase: ""
    },
    selfCares: [],
    checkups: [],
    family: []
})

provide("elderly",elderlyData);

const activeName = ref('first')



const handleClick = (tab: TabsPaneContext, event: Event) => {
  console.log(tab, event)
}

const submit=()=>{

    //把elderlyDatat提交给接口
    console.log(elderlyData);
    
}
</script>
<style scoped>
</style>